-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deployed_contracts
and replaced_classes
to StateDiff
#13
base: main
Are you sure you want to change the base?
Conversation
To verify the state diff commitment we need to have access to all the fields present in the `StateDiff` returned by the feeder gateway. Therefore, we need to have `deployed_contract` and `replaced_classes` in the `StateDiff` messages. The reason for not including the `DeclaredV0Classes` and `DeclaredV1Classes` is because these can be derived from the `Classes` message, which all Cairo0 and Cairo1 classes can be mapped to `DeclaredV0Classes` and `DeclaredV1Classes`, respectively.
A block body contains also the classes that were added. |
After discussion with the team, it is true that both
There is a possible edge case where a contract is deployed and replaced in the same block then an optional Verification of |
@IronGauntlets , why would you need to get the deployed or replaced classes from the state diff? Verification of the state diff should be by executing the transactions. Maybe you are talking about making sure it is consistent with all other changes? |
The signature over the
AFAIU not all nodes would execute transactions and would rely on consensus signatures. Without the changes proposed in this PR verification of the signature is cumbersome for the reasons mentioned above. |
To verify the state diff commitment we need to have access to all the fields present in the
StateDiff
returned by the feeder gateway. Therefore, we need to havedeployed_contract
andreplaced_classes
in theStateDiff
messages.The reason for not including the
DeclaredV0Classes
andDeclaredV1Classes
is because these can be derived from theClasses
message, which all Cairo0 and Cairo1 classes can be mapped toDeclaredV0Classes
andDeclaredV1Classes
, respectively.